package com.ymatou.iapi.withdraw.testcase;

import java.util.List;

import net.sf.json.JSONObject;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.withdraw.parameter.QueryCountBean;
import com.ymatou.iapi.withdraw.service.QueryCountCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.database.model.withdraw.Ymt_InvoiceFundFlowLogExample;
import com.ymttest.database.model.withdraw.Ymt_InvoiceOperationLogExample;
import com.ymttest.database.model.withdraw.Ymt_InvoiceSerialSeedExample;
import com.ymttest.database.model.withdraw.Ymt_WithDrawIdempotentExample;
import com.ymttest.database.model.withdraw.Ymt_WithDrawInvoice;
import com.ymttest.database.model.withdraw.Ymt_WithDrawInvoiceExample;
import com.ymttest.database.model.withdraw.Ymt_WithDrawInvoiceXloboLogExample;
import com.ymttest.database.sqlwapper.WithdrawWapper;
/**
*提现记录统计--买家/买手提现记录查询
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_QueryCount{
	private static QueryCountBean bean;
	private static QueryCountCall call;
	Ymt_WithDrawInvoiceExample ymtinvoive=new Ymt_WithDrawInvoiceExample();//提现申请信息主表
	Ymt_InvoiceSerialSeedExample ymtserialseed=new Ymt_InvoiceSerialSeedExample();//单据编号种子表
	Ymt_WithDrawInvoiceXloboLogExample ymtxlobolog=new Ymt_WithDrawInvoiceXloboLogExample();//提现到贝海的日志
	Ymt_InvoiceFundFlowLogExample ymtflowlog=new Ymt_InvoiceFundFlowLogExample();//资金流转操作日志表
	Ymt_InvoiceOperationLogExample ymtoperationlog=new Ymt_InvoiceOperationLogExample();//单据操作日志表
	Ymt_WithDrawIdempotentExample ymtidempotent=new Ymt_WithDrawIdempotentExample();//提现申请幂等键记录表
	
	WithdrawWapper WithdrawWapper=new WithdrawWapper();

	private final int sellerid=3383;
	private final String sellerName="wesper";
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("提现记录统计--买家/买手提现记录查询");
	}

	@Before
	public void caseUp() {
		bean=new QueryCountBean();
		call=new QueryCountCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(call.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryCount_001() {
		Logger.start(true,"正例-提现记录统计--买家/买手提现记录查询");
		try {
			bean.setUserId(sellerid);
			call.setData(bean);
			call.callService();			
			
			List<Ymt_WithDrawInvoice> invoivelist = WithdrawWapper.getTotalWithDrawInvoiceByUserId(bean.getUserId());
			Logger.verifyEquals(call.getTotal(), invoivelist.size(), "验证申请总条数");
			Logger.verifyEquals("true", call.getSuccess(), "验证申请返回成功");
		    
		     
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}